package cn.itsource.system.service.impl;

import cn.itsource.basic.utils.PageResult;
import cn.itsource.system.domain.SystemDictionaryDetail;
import cn.itsource.system.mapper.SystemDictionaryDetailMapper;
import cn.itsource.system.query.SystemDictionaryDetailQuery;
import cn.itsource.system.service.SystemDictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class SystemDictionaryDetailServiceImpl implements SystemDictionaryDetailService {

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;

    @Override
    public List<SystemDictionaryDetail> findAll() {
        return systemDictionaryDetailMapper.findAll();
    }

    @Override
    public SystemDictionaryDetail findOne(Long id) {
        return systemDictionaryDetailMapper.findOne(id);
    }

    @Override
    public void add(SystemDictionaryDetail systemDictionaryDetail) {

        systemDictionaryDetailMapper.add(systemDictionaryDetail);
    }

    @Override
    public void update(SystemDictionaryDetail systemDictionaryDetail) {
        systemDictionaryDetailMapper.update(systemDictionaryDetail);
    }

    @Override
    public void delete(Long id) {
        systemDictionaryDetailMapper.delete(id);
    }

    @Override
    public void patchdel(Long[] ids) {
        systemDictionaryDetailMapper.patchdel(ids);
    }

    @Override
    public PageResult<SystemDictionaryDetail> queryPage(SystemDictionaryDetailQuery SystemDictionaryDetailQuery) {
        Integer totals = systemDictionaryDetailMapper.queryCount(SystemDictionaryDetailQuery);
        List<SystemDictionaryDetail> list = systemDictionaryDetailMapper.queryData(SystemDictionaryDetailQuery);
        return new PageResult<SystemDictionaryDetail>(totals,list);
    }
}
